import React, { Component } from 'react'
import PubSub from 'pubsub-js'
export default class Son1 extends Component {
  componentDidMount() {
    this.id = PubSub.subscribe('xxx', function (topic, data) {
      console.log('son1', topic, data)
    })
  }
  componentWillUnmount() {
    PubSub.unsubscribe(this.id)
  }
  render() {
    return <div>Son1</div>
  }
}
